package br.com.moxirpt.model.vo.falhainclusao;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import br.com.moxirpt.form.FormUtil;
import br.com.moxirpt.model.log.Form;
import br.com.moxirpt.model.vo.Resumo;

@SuppressWarnings("serial")
@Entity
@Table(name = "data.vw_falha_inclusao_resumo")
@NamedQueries({
	@NamedQuery(name = "FalhaInclusaoResumoVO.obterResumos", query = "from FalhaInclusaoResumoVO f where f.numScreening = :numScreening"),
	@NamedQuery(name="FalhaInclusaoResumoVO.obterItensAuditadosPorNumScreening", query="from FalhaInclusaoResumoVO where numScreening = :numScreening"),
	
	@NamedQuery(name = "FalhaInclusaoResumoVO.obterResumosPorSite", query = "from FalhaInclusaoResumoVO f where f.site = :site"),
	@NamedQuery(name="FalhaInclusaoResumoVO.obterItensAuditadosPorNumScreeningPorSite", query="from FalhaInclusaoResumoVO where numScreening = :numScreening and site = :site")
})
public class FalhaInclusaoResumoVO implements Serializable, Resumo{
	
	@Id
	@Column(name = "idfalha_inclusao", nullable = false)
	private int idfalhaInclusao;
	
	@Column(name = "idlog_screening", nullable = false)
	private int idlogScreening;
	
	@Column(name = "numscreening", nullable = false)
	private String numScreening;
	
	@Column(name = "site", nullable = false)
	private Integer site;
	
	@Transient
	private Integer indice = null;
	
	@Column(name = "dtinclusao", nullable = false)
	@Temporal(TemporalType.DATE)
	private Date dtInclusao;
	
	@Transient
	private String identificacao = null;

	public int getIdfalhaInclusao() {
		return idfalhaInclusao;
	}

	public void setIdfalhaInclusao(int idfalhaInclusao) {
		this.idfalhaInclusao = idfalhaInclusao;
	}

	@Override
	public String getNumScreening() {
		return numScreening;
	}

	public void setNumScreening(String numScreening) {
		this.numScreening = numScreening;
	}

	public Date getDtInclusao() {
		return dtInclusao;
	}

	public void setDtInclusao(Date dtInclusao) {
		this.dtInclusao = dtInclusao;
	}

	public String getIdentificacao() {
		return identificacao;
	}

	public void setIdentificacao(String identificacao) {
		this.identificacao = identificacao;
	}
	
	@Override
	public int getId(){
		return this.getIdfalhaInclusao();
	}
	
	public int getPid(){
		return 0;
	}

	public int getIdlogScreening() {
		return idlogScreening;
	}

	public void setIdlogScreening(int idlogScreening) {
		this.idlogScreening = idlogScreening;
	}

	public Integer getIndice() {
		return indice;
	}

	public void setIndice(Integer indice) {
		this.indice = indice;
	}
	
	public Integer getSite() {
		return site;
	}

	public void setSite(Integer site) {
		this.site = site;
	}
	
	@Override
	public Form getForm(){
		return FormUtil.FormsEnum.FALHA_INCLUSAO.getForm();
	}

}
